package fr.smile.formation;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class OtherServlet extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		req.setAttribute("servlet2Call", System.currentTimeMillis());
		RequestDispatcher rd = getServletContext().getRequestDispatcher("/WEB-INF/test.jsp");
		rd.forward(req, resp);
		//PrintWriter writer = resp.getWriter();
		//writer.println("Arrivée dans servlet deux à "+System.currentTimeMillis()+" | Arrivée dans servlet un à "+req.getAttribute("servlet1Call"));
	}

}
